package com.example.apiBoss.service;

import com.example.apiBoss.remote.ServiceDriverUserClient;
import com.example.internalcommon.dto.DriverUser;
import com.example.internalcommon.dto.ResponseResult;
import lombok.extern.slf4j.Slf4j;
import net.sf.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * @Author lyra
 * @Date 2023/4/12 15:15
 **/
@Service
@Slf4j
public class DriverUserService {

    @Autowired
    private ServiceDriverUserClient serviceDriverUserClient;

    public ResponseResult addDriverUser(DriverUser driverUser){
        log.info(JSONObject.fromObject(driverUser).toString());
        return serviceDriverUserClient.addDriverUser(driverUser);
    }


    public ResponseResult updateDriverUser(@RequestBody DriverUser driverUser){
        return serviceDriverUserClient.updateDriverUser(driverUser);
    }
}
